<script setup>
const props = defineProps(['node']);
</script>

<template>
  <div class="container">
    <div>姓名：{{ node.name }}</div>
    <div v-if="node.children">孩子：<Person v-for="(child, index) in (node.children || [])" :node="child" :key="index" /></div>
  </div>
</template>

<style scoped>
.container {
  padding-left: 20px;
}
</style>